const { Schema, model } = require('mongoose');
const moment = require('moment');

//设置数据集合的数据结构
const adminsSchema = new Schema(
    {
        username: String,
        password: String,
        //默认权限 0
        role: {
            type: String,
            default: 0,
        },
        phone: String,
        time: {
            type: String,
            default: moment().format('YYYY年MM月DD日')
        }
    },
    {
        versionKey: false,
    }
);
// 设置数据集合的模型
const Admins = model('Admins', adminsSchema, 'admins');
module.exports.Admins = Admins;